class ISQLFactory
{
    virtual ISQL* CreateObject()=0;
    virtual ~ISQLFactory();
};

//这里不应该合并成一个抽象类去做处理的，应该设置三个工厂抽象类
class ISQL
{
//...
};

class SqlConnect : public ISQL
{
public:
    String ConnectionString;
};

class SqlCommand : public ISQL
{
    SqlConnect* connection;
    SqlDataReader* reader;
    String CommandText;
public:
    void SetConnection()
    {
        //...
    }

    SqlDataReader* ExecuteReader()
    {
        return reader;
    }
};

class SqlDataReader : public ISQL
{
public:
    void Read()
    {
        //...
    }
};

class SqlConnectFactory : public ISQLFactory
{
public:
    virtual ISQL* CreateObject()
    {
        return new SqlConnect();
    }
};

class SqlCommandFactory : public ISQLFactory
{
public:
    virtual ISQL* CreateObject()
    {
        return new SqlCommand();
    }
};

class SqlDataReaderFactory : public ISQLFactory
{
public:
    virtual ISQL* CreateObject()
    {
        return new SqlDataReader();
    }
};

class EmployeeDAO{
    SqlConnectFactory* connect;
    SqlCommandFactory* command;
    SqlDataReaderFactory* reader;
public:

    vector<EmployeeDO> GetEmployees(){
        connect->CreateObject()->ConnectionString = "...";

        
        command->CreateObject()->CommandText="...";
        command->CreateObject()->SetConnection(connection);

        SqlDataReader* reader = command->CreateObject()->ExecuteReader();
        while (reader->Read()){

        }

    }
};
